package com.shiroha.notification.pojo;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.JacksonTypeHandler;
import com.shiroha.common.event.ServiceEventType;
import com.shiroha.common.handler.UUIDTypeHandler;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Map;
import java.util.UUID;

@Data
@Table(value = "notification", schema = "public")
public class Notification {
    @Id(keyType = KeyType.Auto)
    private Long id;

    @Column(typeHandler = UUIDTypeHandler.class)
    private UUID userId;

    private ServiceEventType type;

    private boolean read;

    @Column(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> payload;

    private LocalDateTime createdAt;
}
